package com.zsy.controller;

import com.zsy.pojo.LoginDto;
import com.zsy.pojo.LoginInfo;
import com.zsy.pojo.Result;
import com.zsy.service.EmpService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: zhengsuyang
 * @Desc:
 * @create: 2025-09-12 21:12
 **/
@RestController
@Slf4j
public class LoginController {
    @Autowired
    private EmpService empService;

    /**
     * 用户登录
     * @param loginDto
     * @return
     */
    @PostMapping("/login")
    private Result login(@RequestBody LoginDto loginDto) {
         LoginInfo loginInfo = empService.login(loginDto);
         return Result.success(loginInfo);
    }
}
